package view;

import java.awt.Dimension;
import javax.swing.JLabel;
import java.awt.Rectangle;
import java.awt.Font;
import java.awt.Color;
import java.awt.Point;

import javax.swing.JFrame;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.SwingConstants;
import javax.swing.ImageIcon;
import javax.swing.JPasswordField;

public class panelConfig extends JFrame {

	private static final long serialVersionUID = 1L;
	private JLabel lbconfig = null;
	private JLabel LabelComputerName = null;
	private JLabel LabelDatebaseName = null;
	private JLabel LabelUser = null;
	private JLabel LabelPassword = null;
	private JTextField txtComputerName = null;
	private JTextField txtDataname = null;
	private JTextField txtUserName = null;
	private JButton btnSave = null;
	private JButton btnExit = null;
	private JPasswordField txtpass = null;

	public panelConfig() {
		super();
		initialize();
	}

	private void initialize() {
		LabelPassword = new JLabel();
		LabelPassword.setText("Password:");
		LabelPassword.setSize(new Dimension(112, 26));
		LabelPassword.setLocation(new Point(50, 210));
		LabelUser = new JLabel();
		LabelUser.setText("User Name:");
		LabelUser.setSize(new Dimension(112, 26));
		LabelUser.setLocation(new Point(50, 168));
		LabelDatebaseName = new JLabel();
		LabelDatebaseName.setText("Database's Name:");
		LabelDatebaseName.setSize(new Dimension(112, 26));
		LabelDatebaseName.setLocation(new Point(50, 127));
		LabelComputerName = new JLabel();
		LabelComputerName.setText("Computer's Name:");
		LabelComputerName.setLocation(new Point(50, 86));
		LabelComputerName.setSize(new Dimension(112, 26));
		lbconfig = new JLabel();
		lbconfig.setBounds(new Rectangle(160, 25, 134, 31));
		lbconfig.setForeground(new Color(8, 110, 72));
		lbconfig.setText("Config System");
		lbconfig.setFont(new Font("Arial", Font.BOLD, 18));
		this.setSize(449, 355);
		this.setLayout(null);
		this.setTitle("Config");
		this.add(lbconfig, null);
		this.add(LabelComputerName, null);
		this.add(LabelDatebaseName, null);
		this.add(LabelUser, null);
		this.add(LabelPassword, null);
		this.add(getTxtComputerName(), null);
		this.add(getTxtDataname(), null);
		this.add(getTxtUserName(), null);
		this.add(getBtnSave(), null);
		this.add(getBtnExit(), null);
		this.add(getTxtpass(), null);
	}

	private JTextField getTxtComputerName() {
		if (txtComputerName == null) {
			txtComputerName = new JTextField();
			txtComputerName.setSize(new Dimension(186, 28));
			txtComputerName.setLocation(new Point(198, 82));
		}
		return txtComputerName;
	}

	private JTextField getTxtDataname() {
		if (txtDataname == null) {
			txtDataname = new JTextField();
			txtDataname.setLocation(new Point(198, 127));
			txtDataname.setSize(new Dimension(186, 28));
		}
		return txtDataname;
	}

	private JTextField getTxtUserName() {
		if (txtUserName == null) {
			txtUserName = new JTextField();
			txtUserName.setLocation(new Point(198, 166));
			txtUserName.setSize(new Dimension(186, 28));
		}
		return txtUserName;
	}

	private JButton getBtnSave() {
		if (btnSave == null) {
			btnSave = new JButton();
			btnSave.setBounds(new Rectangle(162, 264, 91, 30));
			btnSave.setHorizontalTextPosition(SwingConstants.RIGHT);
			btnSave.setIcon(new ImageIcon(getClass().getResource("/image/Save.png")));
			btnSave.setText("Save");
			btnSave.setHorizontalAlignment(SwingConstants.LEFT);
		}
		return btnSave;
	}

	private JButton getBtnExit() {
		if (btnExit == null) {
			btnExit = new JButton();
			btnExit.setHorizontalTextPosition(SwingConstants.RIGHT);
			btnExit.setIcon(new ImageIcon(getClass().getResource("/image/Close.png")));
			btnExit.setText("Exit");
			btnExit.setLocation(new Point(281, 264));
			btnExit.setSize(new Dimension(91, 30));
			btnExit.setHorizontalAlignment(SwingConstants.LEFT);
		}
		return btnExit;
	}

	/**
	 * This method initializes txtpass	
	 * 	
	 * @return javax.swing.JPasswordField	
	 */
	private JPasswordField getTxtpass() {
		if (txtpass == null) {
			txtpass = new JPasswordField();
			txtpass.setLocation(new Point(198, 210));
			txtpass.setSize(new Dimension(186, 28));
		}
		return txtpass;
	}

}  //  @jve:decl-index=0:visual-constraint="10,10"
